<template>
    <view class="container_2">
        <view class="news">
            <view class="newslist" v-for="(item, index) in userlist" :key="index">
                <view class="title" @tap="toWorkerDetail" :data-id="item.id">
                    <view class="detail">
                        <view class="info">
                            <view>{{ item.nickname }}</view>
                            <view></view>
                            <view class="jobmoney">
                                状态:
                                <text>{{ item.status }}</text>
                            </view>
                        </view>

                        <view class="pic">
                            <image :src="item.avatarUrl"></image>

                            <text class="time">{{ item.create_time }}</text>
                        </view>
                    </view>
                </view>
            </view>

            <view class="logincompany" v-if="companyid == 0">
                <view>成为企业会员，高效挑选人才!</view>

                <view><button @tap="toLogin">登录企业</button></view>
                <view @tap="doCall" :data-tel="intro.tel">客服服务热线:{{ intro.tel }}</view>
            </view>
        </view>
    </view>
</template>

<script>
import { Agent } from '../../model/agent-model.js';
var agent = new Agent();
export default {
    data() {
        return {
            userlist: '',
            companyid: 0,

            intro: {
                tel: ''
            }
        };
    }
    /**
     * 生命周期函数--监听页面加载
     */,
    onLoad: function (options) {
        var that = this;
        uni.setNavigationBarTitle({
            title: '我的推广记录'
        });
        var params = {};
        agent.Agentfxrecord((data) => {
            that.setData({
                userlist: data.userlist
            });
        }, params);
    },
    /**
     * 生命周期函数--监听页面初次渲染完成
     */
    onReady: function () {},
    /**
     * 生命周期函数--监听页面显示
     */
    onShow: function () {},
    /**
     * 生命周期函数--监听页面隐藏
     */
    onHide: function () {},
    /**
     * 生命周期函数--监听页面卸载
     */
    onUnload: function () {},
    /**
     * 页面相关事件处理函数--监听用户下拉动作
     */
    onPullDownRefresh: function () {},
    /**
     * 页面上拉触底事件的处理函数
     */
    onReachBottom: function () {},
    /**
     * 用户点击右上角分享
     */
    onShareAppMessage: function () {},
    methods: {
        toWorkerDetail() {
            console.log('占位：函数 toWorkerDetail 未声明');
        },

        toLogin() {
            console.log('占位：函数 toLogin 未声明');
        },

        doCall() {
            console.log('占位：函数 doCall 未声明');
        }
    }
};
</script>
<style>
.container_2 {
    background-color: #f0f1f5;
    min-height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.news {
    margin-top: 10rpx;
    width: 100%;
    display: flex;
    flex-direction: column;
}
.news .newstitle {
    width: 100%;
    height: 80rpx;
    line-height: 80rpx;
    margin-left: 20rpx;
    font-size: 0.7rem;
    border-bottom: 1rpx solid #efefef;
    margin: 0 auto;
    display: flex;
    flex-direction: row;
    align-content: center;
}

.news .newstitle view:nth-child(1) {
    height: 40rpx;
    line-height: 40rpx;
    width: 6rpx;
    background: #3274e5;
    align-self: center;
    margin-left: 10rpx;
}
.news .newstitle view:nth-child(2) {
    height: 80rpx;
    line-height: 80rpx;
    width: 150rpx;
    padding-left: 15rpx;
}

.news .newslist {
    display: flex;
    flex-direction: row;
    width: 720rpx;
    margin: 0 auto;
    padding: 20rpx;
    margin-bottom: 20rpx;
    background: #fff;
}

.news .newslist .title {
    width: 100%;
    flex-direction: column;
    display: flex;
    justify-content: space-between;
}

.news .newslist .title .detail {
    padding-left: 2%;
    text-align: left;
    font-size: 0.8rem;
    color: #000;
    display: flex;
    flex-direction: row;
    width: 100%;
}

.news .newslist .title .detail .pic {
    width: 30%;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}

.news .newslist .title .detail .pic image {
    width: 120rpx;
    height: 120rpx;
    align-self: center;
    border-radius: 60rpx;
}
.news .newslist .title .detail .pic text {
    font-size: 10px;
    color: #646464;
}

.footimg {
    width: 40rpx;
    height: 40rpx;
    position: absolute;
    left: 120rpx;
    right: 0;
    top: 80rpx;
}

.news .newslist .title .detail .info {
    width: 65%;
}

.news .newslist .title .detail .info view:nth-child(1) {
    padding-top: 10rpx;
    color: #000;
    font-weight: bold;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    font-size: 15px;
}

.news .newslist .title .detail .info view:nth-child(2) {
    padding-top: 10rpx;
    padding-bottom: 10rpx;
    color: #646464;
    font-size: 12px;
}

.news .newslist .title .detail view:nth-child(3) {
    padding-top: 10rpx;
    padding-right: 10rpx;
}
.news .newslist .title .price {
    width: 28%;
}

.news .newslist .title .price .money {
    color: #d65408;
    font-weight: bold;
    font-size: 0.7rem;
    padding-right: 10rpx;
}

.jobname > text {
    color: #b7b7b7;
}
.jobmoney {
    display: flex;
    flex-direction: row;
    justify-content: flex-start;
    color: #646464;
    font-size: 13px;
}

.jobmoney text {
    color: #1296db;
    margin-left: 10rpx;
}
.info .time {
    color: #ff4129;
    font-size: 0.7rem;
}
</style>
